home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / c_wndw.zip / C_WNDW.H < prev    next >
Text File  |  1989-05-25  |  9KB  |  230 lines

  1. /* header file for windowing system 
  2. *
  3. *    (c) Marietta Systems, Inc.  1987
  4. *    All rights reserved
  5. *
  6. *   Global variables for the windowing system.
  7. *    
  8. *    Do not change these! 
  9. *        
  10. */
  11. #ifndef LATTICE
  12. typedef unsigned char byte;
  13. #define _STACK _stklen
  14. #define fileclose fileclos
  15. #define filewrite filewrit
  16. #endif
  17. /*    
  18. */
  19. long _SIZMEM = 0;
  20. int SAVEWAIT = 900, A_TRACK = -1;
  21. unsigned SCRN_PTR, CLR_PTR = 0X0000, _DSEG, _DOFF, CLR_SEG = 0XB800, 
  22.     MONO_SEG = 0XB000;
  23. short SCR_SIZE, OLD_CODE, _brkflag;
  24. byte INCHAR = 32, INCHAR_F = 0, _D_ERROR = 0, _D_MSG = 0, FN_DEBUG = 0; 
  25. byte INS_FLAG = 1, CLR_INIT = 0, W_NUM = 0, BUG_TEST = 0, MEM_TEST = 0;
  26. byte COLOR_SC = 0, EGA_SCRN = 0, CLR_CODE = 0 , *MEM_LINE, CLR_TONE = 1;
  27. enum fld_type {alphanum, graphic, flag, boolean, calendar, numeric, value, 
  28.     real, chrono};
  29. enum COLOR_OF  {black,blue,green,cyan,red,magenta,yellow,white};
  30. enum _JUST {left,right,as_typed,center,code,decimal,c_number,date,time};
  31. enum ATTRIB {low,high,reverse,blink,blank,alt_low,alt_high,alt_reverse} 
  32.     OLD_BRIG = low;
  33. enum F_READ {firstrec, previous, nextrec, lastrec, random, relative};
  34. enum F_MODE {append, readonly, recreate, update};
  35. enum F_TYPE {ascii, binary, dbase3, hashed, marietta};
  36. struct CURSR {byte X,Y;} _CURSOR; /* Current cursor position in window */
  37. struct WINDW {  /* window tracking struct */
  38.     byte X, Y, H, W, P, *SCREEN, *FUNCTION;
  39.     int CODE;
  40.     } *WINDOW;
  41. struct CLR_TYPE {
  42.     enum COLOR_OF FORE, BACK;
  43.     int ALT_CLR;
  44.     };
  45. struct DBF_DEF{ /* dBase III Plus data dictionary struct */
  46.     byte dbf_name[11], dbf_type, dbf_len, dbf_dec, dbf_set, dbf_dig;
  47.     byte dbf_fill[16];
  48.     };
  49. struct F_DEF { /* file definition control struct */
  50.     long prime, location, r_count;
  51.     int key_len, offset, start, rec_len, fbloc;
  52.     enum F_TYPE ftype;
  53.     byte keycode, *fptr, *record, write;
  54.     char fname[13];
  55.     char *fnext; /* pointer to data dictionary */
  56.     } FN[20];
  57. /*
  58. *    Configuration constants
  59. *
  60. *    Change their initial value to suit your set-up
  61. *        - but be careful!!
  62. *
  63. */ 
  64. struct CLR_TYPE COLOR [7] = {    /* number of elements must match 
  65.                                    "_COLOR" config constant */
  66.         {green, black, 6},        /* base window color, #0 */
  67.         {white, blue, 3},        /* color #1 */
  68.         {cyan, black, 4},        /* color #2 */
  69.         {cyan, red, 5},            /* color #3 */
  70.         {white, magenta, 2},    /* color #4 */
  71.         {yellow, black, 1},        /* color #5 */
  72.         {white, red, 0},        /* color #6 */
  73.                 };
  74. struct CLR_TYPE    TOP_CLR = {yellow,magenta,6}; /* top line color */
  75. struct CLR_TYPE    ER_COLOR = {green,red,6};    /* bottom line color */
  76. /*        */
  77. enum ATTRIB ACC_DISP = reverse; /* Attribute of accept fields after entry */
  78. byte ERR_BEEP = 2;    /* For beep length with 'disp_err', 0 = tiny beep */
  79. byte UP_NAME = 0;    /* 1 if names are to be in uppercase only */
  80. byte FLD_FULL = 1;  /* 1 for auto ENTER on full field; 0 = ENTER required */
  81. byte TAB_SET = 4;    /* size of tab increments on screen for '\t' code */
  82. byte _WINDW = 10;    /* maximum number of windows */
  83. byte _COLOR = 7;    /* maximum number of different color selections */
  84. byte SCRN_LEN = 25; /* screen length in lines */
  85. byte SCRN_WID = 80;  /* screen width in columns */
  86. byte TOP_LINE = 1; /* lines dedicated to the "top-frame" at top of screen */
  87. byte MAXFILES = 20; /* maximum number of files for operating system */
  88. byte D_FORMAT = 'U'; /* U for USA format, E for european, I for intl */
  89. byte D_PUNCT = '/';     /* punctuation character for date formats */
  90. byte D_20XX = 10;    /* split between 20xx and 19xx in years */
  91. byte PERIOD = '.';     /* decimal point character */
  92. byte COMMA = ',';     /* thousands seperator */
  93. byte BOOL_YES = 'Y'; /* The TRUE or YES boolean entry code */
  94. byte BOOL_NO = 'N';  /* The FALSE or NO boolean entry code */
  95. char *xgoodbye;
  96. unsigned KEYMATCH[8] /* the key match array which determines which
  97.                         function keys are treated as 'end-of-field'
  98.                         keys by the 'isendch' function */
  99.     = {0X428, 0X584, 0X0, 0X0, 0X0, 0X0, 0X0, 0X0};    
  100.          /* this activates all basic cursor related function keys :
  101.          Pgup, Up, Pgup, Home, Down, End, Ctrl+Enter
  102.          */ 
  103. int DISCBLCK = 512; /* maximum record size of any file to be opened,
  104.                Minimum size is 65, but recommended minimum is 256.  */
  105. short MEM_WARN = 4096; /* Warning will be issued when unused heap memory is
  106.                           under this.  Maximum is 9999, minimum is 2048 */
  107. long MAX_WIND = 15000L;    /* maximum amount of heap space for windowing 
  108.                functions. The minimum size of MAX_WIND should be 8500.
  109.                To calculate, use the formula :-
  110.                ((number of windows * average size * 2) + 2500)
  111.                  where 'average size' is (height * width)
  112.                         */
  113. long _MNEED = 20000L; /* minimum heap space to be allocated, which must be 
  114.                at least MAX_WIND + 5000. */
  115. unsigned _STACK = 10000; /* size of stack, (at least 5000) */
  116. /* 
  117. *
  118. *     This section contains the #define codes 
  119. *    
  120. */
  121. #define CTL_A     1 /* all the other CTL combinations can be defined here */
  122. #define PGDN      3
  123. #define CRS_RT    4 /* Right cursor */
  124. #define CRS_UP    5 /* Up cursor */
  125. #define DEL       7
  126. #define B_SPACE   8
  127. #define TAB       9
  128. #define CTL_ENT  10
  129. #define SFT_TAB  11
  130. #define ENTER    13
  131. #define PGUP     18
  132. #define CRS_LT   19 /* Left cursor */
  133. #define CTL_BSPC 20 /* Ctrl + backspace */
  134. #define INS      22
  135. #define HOME     23
  136. #define CRS_DN   24 /* Down cursor */
  137. #define END      26
  138. #define CTL_Z    26 /* 0X1A */
  139. #define ESC      27
  140. #define ALT_Q   129 /* The other ALT alpha keys can be defined here */
  141. #define ALT_P   138 /* Print translated screen */
  142. #define QUIT_NOW 158 /* Alt+X used for fast terminate of program */
  143. #define ALT_M   163
  144. #define HELP    168 /* F1 Key  */
  145. #define UNDO    169 /* F2 Key  */
  146. #define SEARCH  170 /* F3 Key  */
  147. #define MOVE    171 /* F4 Key  */
  148. #define INSERT  172 /* F5 Key  */
  149. #define DELETE  173 /* F6 Key  */
  150. #define ZOOM    174 /* F7 Key  */
  151. #define AMEND   175 /* F8 Key  */
  152. #define KEY_CH  176 /* F9 Key  */
  153. #define QUIT    177 /* F10 Key */
  154. /* 174 thru 218 reserved for standard graphics characters */
  155. #define SFT_F1  220 /* The other SHIFT+Fnn keys can be defined here */ 
  156. #define SFT_F10 229
  157. #define CTL_LT  248 /* Ctrl + left cursor */
  158. #define CTL_RT  249 /* Ctrl + right cursor */
  159. #define CTL_END 250
  160. #define CTL_PGDN 251
  161. #define CTL_HOME 252
  162. #define CTL_PGUP 254
  163. /*         */
  164. #define DELETED 0X2A /* '*' code has dBase 3+ compatibility */
  165. #define IN_USE  0X20 /* ' ' code has dBase 3+ compatibility */
  166. #define EMPTY   0X26 /* '&' code, for hashed files */
  167. #define SYS_REC 0X03 /* code has dBase 3+ compatibility */
  168. /*        */
  169. #define MFALSE  128
  170. #define MTRUE   129
  171. /* 
  172. *
  173. *    The external functions used by windowing software    
  174. *
  175. */
  176. extern int   accept(byte*,enum _JUST,enum ATTRIB,int,int);
  177. extern void  box_scrn(void);
  178. extern void  check_f(void);
  179. extern void  clr_scrn(char*);
  180. extern void  clr_wndw(void);
  181. extern byte*  concat(byte*,int);
  182. extern int   datecomp(char*,char*);
  183. extern long  datelong(char*);
  184. extern void  datemath(char*,int);
  185. extern void  dateread(char*);
  186. extern void  date_in(char*,char*);
  187. extern void  date_out(char*,char*);
  188. extern int   dbf_fld(int);
  189. extern void  display(byte*,int,int,enum ATTRIB);
  190. extern void  disp_err(char*,int);
  191. extern void  disp_msg(char*,int);
  192. extern byte  disp_qry(char*);
  193. extern int   fileback(char*);
  194. extern int   fileclos(int);
  195. extern int   filedbf(int,struct DBF_DEF**);
  196. extern int   fileinit(int,unsigned,unsigned,long);
  197. extern int   fileopen(char*,enum F_TYPE,enum F_MODE);
  198. extern int   fileread(int,enum F_READ,long*);
  199. extern int   fileseek(int,long);
  200. extern int   filewrit(int,long*);
  201. extern int   file_err(int,int);
  202. extern int   fld_len(enum _JUST,int,int);
  203. extern void  goodbye(short); 
  204. extern byte  grabchar(void);
  205. extern int   hashmake(char*,unsigned,unsigned,long,unsigned,unsigned);
  206. extern long  hashread(int,byte*,int);
  207. extern void  helpmenu(int);
  208. extern int   helpscrn(byte*);
  209. extern void  idleloop(int);
  210. extern int   isendch(byte*,byte,enum ATTRIB);
  211. extern void  justify(enum _JUST,byte*,byte*,int,int);
  212. extern int   menu(char*,int,int,int);
  213. extern int   mk_wndw(int,int,int,int,byte*);
  214. extern int   mrtbrk(void);
  215. extern long  primenbr(long);
  216. extern void  prn_scrn(void);
  217. extern void  read_kb(void);
  218. extern int   rm_wndw(void);
  219. extern void  scrnsave(int);
  220. extern void  scrn_map(byte*,int,int);
  221. extern void  scroll(int,int);
  222. extern void  set_clr (int,enum ATTRIB);
  223. extern void  set_crsr (int,int);
  224. extern int   top_menu(char*,int,int);
  225. extern void  top_spot(int);
  226. extern int   validate(byte*,enum _JUST,int,int);
  227. extern int   v_bool(char);
  228. extern void  warble(int);
  229. /*     end of header file */
  230.